package com.sondon.mayi.yicache;

/**
 * 
 * @ClassName: YiMemoryCache
 * @package com.sondon.mayi.yicache
 * @author mayi
 * @date 2015-6-14 上午2:32:51
 * @Description: TODO( 
 * 内存缓存实现类  ：
 * 		封装操作接口，供外部使用
 *  )
 * @version 1.0
 *
 * @param <K>
 * @param <V>
 */
public class YiMemoryCache<K, V> extends InAbsCache<K, V> {
	/**
	 * 构造函数
	 */
	public YiMemoryCache(int cacheSize) {
		super(cacheSize);
	}

	
	@Override
	public void cache(K key, V value) {
		cacheToMemory(key, value);
	}

	@Override
	public V get(K key) {
		return getFromMemory(key);
	}

	@Override
	public boolean containsKey(K key) {
		return memoryCacheContainsKey(key);
	}

	@Override
	public void removeCache(K key) {
		removeMemoryCache(key);
	}
}
